package util.AST;

import java.util.ArrayList;

import util.AST.Declarations.Declaration;
import util.AST.Declarations.FunctionDeclaration;
import util.AST.Declarations.ProcedureDeclaration;
import checker.SemanticException;
import checker.Visitor;

public class Comand extends Program {

	private ArrayList<ProcedureDeclaration> pd = new ArrayList<ProcedureDeclaration>();
	private ArrayList<FunctionDeclaration> fn = new ArrayList<FunctionDeclaration>();	
	
	public Comand(ArrayList<ProcedureDeclaration> pd,
			ArrayList<FunctionDeclaration> fn) {
		super();
		this.pd = pd;
		this.fn = fn;
	}
	public Comand() {
	}
	
	public void addP (ProcedureDeclaration p){
		this.pd.add(p);
	}
	public void addF (FunctionDeclaration f){
		this.fn.add(f);
	}

	public ArrayList<ProcedureDeclaration> getPd() {
		return pd;
	}

	public void setPd(ArrayList<ProcedureDeclaration> pd) {
		this.pd = pd;
	}

	public ArrayList<FunctionDeclaration> getFn() {
		return fn;
	}

	public void setFn(ArrayList<FunctionDeclaration> fn) {
		this.fn = fn;
	}

	@Override
	public String toString(int level) {
		return super.getSpaces(level);
	}

	@Override
	public Object visit(Visitor v, Object o) throws SemanticException {
		// TODO Auto-generated method stub
		return v.visitProgram(this, o);
	}

//	@Override
//	public Object visit(Visitor v, Object o) throws SemanticException {
//		// TODO Auto-generated method stub
//		return v.visitProgram(this, o);
//	}

}
